home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13869 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  55 lines

  1. Path: news.tiac.net!usenet
  2. From: lindak@pumpkin.iii.net (Linda Kasparek)
  3. Newsgroups: comp.lang.c++
  4. Subject: STL vector and compiler warnings
  5. Date: 27 Mar 1996 18:12:53 GMT
  6. Organization: iii.net subscriber
  7. Message-ID: <4jc0f5$b43@news.tiac.net>
  8. Reply-To: jmk@tiac.net
  9. NNTP-Posting-Host: jmk.tiac.net
  10. X-Newsreader: WinVN 0.92.6+
  11.  
  12. Does anyone know what causes the following compiler warnings (MS VC++ 4.0):
  13.  
  14. Compiling...
  15. Vec1.cpp
  16. \tctools\stl\iterator.h(64) : warning C4114: same type qualifier used more than once
  17. \tctools\stl\iterator.h(64) : warning C4114: same type qualifier used more than once
  18. Vec1.obj - 0 error(s), 2 warning(s)
  19.  
  20. (Here's what the docs say about this warning:
  21. same type qualifier used more than once
  22. A type qualifier (const, volatile, signed, or unsigned) was used more than once in the same type declaration or definition.
  23. The second occurrence of the qualifier was ignored. This is a warning when Microsoft extensions are enabled (/Ze) and an error when extensions are disabled (/Za).
  24. The following is an example of this warning:
  25.   
  26. volatile volatile int i;   // warning)
  27.  
  28. I get these warnings when I compile ObjectSpace's vec1.cpp example:
  29.  
  30. // Copyright (c) 1995 by ObjectSpace, Inc.  All rights reserved.
  31. // Email: sales@objectspace.com, ccs.support@objectspace.com
  32. // Last Modified: $Date: 1995/07/23 16:24:57 $
  33.  
  34. #include <iostream.h>
  35. //#include <stl.h>
  36. #include <vector.h>
  37.  
  38. int main ()
  39. {
  40.   vector<int> v1; // Empty vector of integers.
  41.   cout << "empty = " << v1.empty () << "\n";
  42.   cout << "size = " << v1.size () << "\n";
  43.   cout << "max_size = " << v1.max_size () << "\n";
  44.   v1.push_back (42); // Add an integer to the vector.
  45.   cout << "size = " << v1.size () << "\n";
  46.   cout << "v1[0] = " << v1[0] << "\n";
  47.   return 0;
  48. }
  49. 
  50. They're only warnings, but still!
  51.  
  52. Thanks in advance,
  53.  
  54. Linda
  55.